package branch;

public class loop
{
    public static void main(String[] args)
    {
//        test1();
//        System.out.println("1到n的和是：" + test2(100));
//        test3();
        test4();

    }
    public static void test1()
    {
        int i = 0;
        for(i = 0;i < 3;i++)
        {
            System.out.println("hehe");
        }
    }

    public static int test2(int n)
    {
        int i = 0;
        int sum = 0;
        for(i=1;i<=n;i++)
        {
            sum+=i;
        }
        return sum;
    }
    public static void test3() {
        int sum = 0;

        for (int i = 1; i <= 10; i += 2) {
            sum += i;
        }
        System.out.println(sum);

    }
    public static void test4()
    {
        int ret = 0;
        int i = 0;
        for(i = 100;i <1000;i++)
        {
            //123  123%10=23
            int one = (i%100)%10;
            int ten = (i%100)/10;
            int hundred = i/100;
            ret = (int)(Math.pow(one,3)+Math.pow(ten,3)+Math.pow(hundred,3));

            if(ret == i)
            {
                System.out.println(ret);
            }
        }

    }

}


